import {
  Entity,
  Column,
  ManyToMany,
  JoinTable,
  OneToOne,
  JoinColumn,
  OneToMany,
} from 'typeorm';
import { Base } from './base.entity';
import { ApiProperty } from '@nestjs/swagger';
import { TemplateCategory } from './template-category.entity';
import { FileEntity } from './file.entity';
import { Work } from './work.entity';
import { Collection } from './collection.entity';
import { User } from './user.entity';

@Entity()
export class Template extends Base {
  @Column({ length: 20 })
  @ApiProperty({ title: '名称' })
  name: string;

  @Column({ type: 'text', nullable: true })
  @ApiProperty({ title: '描述' })
  description: string;

  @Column({ default: 0 })
  @ApiProperty({ title: '价格', default: 0 })
  price: string;

  @Column({ default: 1 })
  @ApiProperty({ title: '积分', default: 1 })
  integral: string;

  @Column({ name: 'categoryId' })
  categoryId: string;

  @ApiProperty({ title: '展示示例图片' })
  url: string;

  @Column({ length: 20 })
  @ApiProperty({ title: '名称' })
  title: string;

  files: FileEntity[];
}
